package club.xinghe.servlet.admin;

import club.xinghe.biz.AdminBiz;
import club.xinghe.entity.Grade;
import club.xinghe.entity.Yx;
import club.xinghe.util.JsonServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @create刘艺广
 */
@WebServlet("/admin/ShowGradeServlet")
public class ShowGradeServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        AdminBiz adminBiz=new AdminBiz();
        //得到所有年级的集合
        List<Grade> gradeList=adminBiz.getAllGrade();

        JsonServlet.getJson(request,response,gradeList);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    }
}
